<template>
  <div class="evaluate">
    <el-main>
      <hr />
      <h3>其他买家，需要你的建议哦！</h3>
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="您的建议">
          <el-input type="textarea" v-model="form.desc"></el-input>
        </el-form-item>
      </el-form>
      <el-form>
        <el-button type="primary" @click="onSubmit(form.desc)">主要按钮</el-button>
      </el-form>
    </el-main>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        desc: ""
      }
    };
  },
  methods: {
    onSubmit(desc) {
      let tradeID = 3
      console.log("tradeID",tradeID)
      this.$axios.post("http://localhost:3000/evaluate/insetEvaluate",{
        tradeID:3,
        content:desc
      })
      .then(res => {
        console.log("添加成功")
      })
      .catch(err => {
        console.log("添加失败",err)
      })
    }
  }
};
</script>

<style scoped>
.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 160px;
}
.evaluate {
  width: 60%;
  margin: 0 auto;
}
.el-button {
  margin: 0 auto;
}
</style>

